package com.alphawavesgames.engine.rendering;

import java.nio.Buffer;

/**
 *
 * @author Duncan
 */
//abstract base for all element stream types
//override for any type of data you want in a vertex stream ( e.g. float, int )
public abstract class ElementStream
{
    //size of one element in the stream
    protected int m_elementSize;
    //number of elements per block
    protected int m_numElemsPerBlock;
    //number of blocks in the stream
    protected int m_numBlocks;

    //enum of the different types of data stored in streams
    public enum StreamType
    {
        POSITION,
        TEXCOORD,
        //NORMAL,
        //COLOUR
    }

    protected StreamType m_dataType;

    public ElementStream()
    {
        m_elementSize = 0;
        m_numBlocks = 0;
        m_numElemsPerBlock = 0;
        m_dataType = StreamType.POSITION;
    }

    public abstract Buffer getBuffer();

    public StreamType getStreamType() { return m_dataType; }
    public int getNumElementsPerBlock() { return m_numElemsPerBlock; }
    public int getBlockSize() { return m_numElemsPerBlock * m_elementSize; }
    public int getStreamSize() { return m_elementSize * m_numElemsPerBlock * m_numBlocks; }

}